package com.fatcat.easybuy.mapper;


import com.fatcat.easybuy.pojo.EasyBuyUserAddress;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Fatcat
 * @description 针对表【easybuy_user_address】的数据库操作Mapper
 * @createDate 2025-09-10 11:11:58
 * @Entity generator.domain.EasybuyUserAddress
 */
@Mapper
public interface EasyBuyUserAddressMapper {

    //检查用户地址数量(最大为16)
    Integer selectAddressCountOfUser(Long userId);

    //根据用户id查询用户地址
    List<EasyBuyUserAddress> selectUserAddressByUserId(Long userId);

    EasyBuyUserAddress selectAddressById(Integer addressId);

    //设置默认
    int setDefault(Integer id);

    //将该用户的其他地址设置为非默认
    Integer setAllAddressNotDefault(Long userId);

    //增删改
    int addUserAddress(EasyBuyUserAddress easyBuyUserAddress);

    int updateAddress(EasyBuyUserAddress easyBuyUserAddress);

    int deleteAddress(Integer id);
}




